<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('dayOffs')}">
</@showTitle>

<div id="error" style="display:none"></div>

<form action="system/editDayOff.sgt" validator="system/validateDayOff.sgt" onsubmit="submitFormValidation(this); return false;">
	<table id="dataTable" align="center" cellspacing="5" cellpadding="0">
		<tr>
			<td class="name">From Date:</td>
			<td><input type="text" name="date" value="${(dayOff.date?date)!}" style="width:200px"/> <img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].date, '${i18n.getMessage('format.date')}', this)"/></td>
		</tr>
		<tr>
			<td class="name">To Date:</td>
			<td><input type="text" name="endDate" value="${(dayOff.endDate?date)!}" style="width:200px"/> <img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].endDate, '${i18n.getMessage('format.date')}', this)"/></td>			
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('name')}:</td>
			<td><input type="text" name="comment" value="${(dayOff.comment)!}" style="width:200px"/></td>
		</tr>
		<tr>
			<td class="name"> ${i18n.getMessage('options')}:</td>
			<td><input type="checkbox" name="yearlyRepeat" value="true" <#if (dayOff.yearlyRepeat)!false>checked</#if>/> ${i18n.getMessage('dayOffs.yearly')}</td>
		</tr>
		<tr>
			<td class="name"></td>
			<td>
				<input type="submit" href="#" value="${i18n.getMessage('update')}" class="button_style"/> 
			</td>
		</tr>
	</table>
</form>

<br/>

<@display.table id="listTable" name="dayOffs" pagesize="30">
	<@display.column title="${i18n.getMessage('fromDate')}" style="text-align:center;width:100px">
		<#if listTable.yearlyRepeat>
			${(listTable.date?date)?string("dd/MM")}
		<#else>
			${(listTable.date?date)!}	
		</#if>
	</@display.column>
	<@display.column title="${i18n.getMessage('toDate')}" style="text-align:center;width:100px">
		<#if listTable.yearlyRepeat>
			${(listTable.endDate?date)?string("dd/MM")}
		<#else>
			${(listTable.endDate?date)!}	
		</#if>
	</@display.column>
	<@display.column title="${i18n.getMessage('comment')}">${(listTable.comment)!}</@display.column>
	<@display.column title="${i18n.getMessage('dayOffs.yearly')}" style="text-align:center;width:100px">
		<input type="checkbox" <#if (listTable.yearlyRepeat)>checked</#if>/>
	</@display.column>
	<@display.column title="${i18n.getMessage('edit')}" style="text-align:center;width:50px;"><img src="images/edit.gif" style="cursor:pointer" onclick="cc('system/showListDayOff.sgt?id=${listTable.id}')"/></@display.column>
	<@display.column title="${i18n.getMessage('delete')}" style="text-align:center;width:50px;"><img src="images/delete.gif" style="cursor:pointer" onclick="if(confirm('${i18n.getMessage('dialog.delete')}')) { cc('system/deleteDayOff.sgt?id=${listTable.id}'); }"/></@display.column>
</@display.table>

<br/><br/>

<script>